﻿using System.ComponentModel;

namespace XYS.Core.Models
{
    /// <summary>
    /// 状态码
    /// 默认可使用 HttpStatusCode 枚举的状态码，如果该枚举无法满足业务时，可扩展（为防止和 HttpStatusCode 枚举冲突，建议自定义的错误码从 1000 开始）
    /// 5开头的状态码，表示前端仅仅在浏览器控制台打印出来，方便定位问题，但向用户展示时，可以使用全局统一的话术，例如：系统正在开小差，请稍后重试！
    /// </summary>
    public enum EnumStatusCode
    {
        #region http状态码 - 系统枚举：System.Net.StatusCode 100-500

        /// <summary>
        ///  Equivalent to HTTP status 100. System.Net.HttpStatusCode.Continue indicates that
        ///  the client can continue with its request.
        ///  临时响应
        ///  请求者应当继续提出请求。服务器返回此代码表示已收到请求的第一部分，正在等待其余部分。
        /// </summary>
        [Description("继续")]
        Continue = 100,

        /// <summary>
        ///  Equivalent to HTTP status 101. System.Net.HttpStatusCode.SwitchingProtocols indicates
        ///  that the protocol version or protocol is being changed.
        ///  临时响应
        ///  请求者已要求服务器切换协议，服务器已确认并准备切换。
        /// </summary>
        [Description("切换协议")]
        SwitchingProtocols = 101,

        /// <summary>
        ///  Equivalent to HTTP status 102. System.Net.HttpStatusCode.Processing indicates
        ///  that the server has accepted the complete request but hasn't completed it yet.
        ///  临时响应
        ///  由WebDAV（RFC 2518）扩展的状态码，代表处理将被继续执行
        /// </summary>
        [Description("继续执行")]
        Processing = 102,

        /// <summary>
        /// Equivalent to HTTP status 103. System.Net.HttpStatusCode.EarlyHints indicates
        /// to the client that the server is likely to send a final response with the header
        /// fields included in the informational response.
        ///  临时响应
        ///  预加载(css、js)文档
        /// </summary>
        [Description("预加载")]
        EarlyHints = 103,


        /// <summary>
        /// Equivalent to HTTP status 200. System.Net.HttpStatusCode.OK indicates that the
        /// request succeeded and that the requested information is in the response. This
        /// is the most common status code to receive.
        /// 成功
        /// 服务器已成功处理了请求。通常，这表示服务器提供了请求的网页。如果是对您的 robots.txt 文件显示此状态码，则表示 Googlebot 已成功检索到该文件。
        /// </summary>
        [Description("成功")]
        OK = 200,

        /// <summary>
        /// Equivalent to HTTP status 201. System.Net.HttpStatusCode.Created indicates that
        /// the request resulted in a new resource created before the response was sent.
        /// 成功
        /// 请求成功并且服务器创建了新的资源。
        /// </summary>
        [Description("已创建")]
        Created = 201,

        /// <summary>
        /// Equivalent to HTTP status 202. System.Net.HttpStatusCode.Accepted indicates that
        /// the request has been accepted for further processing.
        /// 成功
        /// 服务器已接受请求，但尚未处理。
        /// </summary>
        [Description("已接受")]
        Accepted = 202,

        /// <summary>
        /// Equivalent to HTTP status 203. System.Net.HttpStatusCode.NonAuthoritativeInformation
        /// indicates that the returned meta information is from a cached copy instead of
        /// the origin server and therefore may be incorrect.
        /// 成功
        /// 服务器已成功处理了请求，但返回的信息可能来自另一来源。
        /// </summary>
        [Description("非授权信息")]
        NonAuthoritativeInformation = 203,

        /// <summary>
        /// Equivalent to HTTP status 204. System.Net.HttpStatusCode.NoContent indicates
        /// that the request has been successfully processed and that the response is intentionally
        /// blank.
        /// 成功
        /// 服务器成功处理了请求，但没有返回任何内容。
        /// </summary>
        [Description("无内容")]
        NoContent = 204,

        /// <summary>
        /// Equivalent to HTTP status 205. System.Net.HttpStatusCode.ResetContent indicates
        /// that the client should reset (not reload) the current resource.
        /// 成功
        /// 服务器成功处理了请求，但没有返回任何内容。与 204 响应不同，此响应要求请求者重置文档视图（例如，清除表单内容以输入新内容）。
        /// </summary>
        [Description("重置内容")]
        ResetContent = 205,

        /// <summary>
        /// Equivalent to HTTP status 206. System.Net.HttpStatusCode.PartialContent indicates
        /// that the response is a partial response as requested by a GET request that includes
        /// a byte range.
        /// 成功
        /// 服务器成功处理了部分 GET 请求。
        /// </summary>
        [Description("部分内容")]
        PartialContent = 206,

        /// <summary>
        /// Equivalent to HTTP status 207. System.Net.HttpStatusCode.MultiStatus indicates
        /// multiple status codes for a single response during a Web Distributed Authoring
        /// and Versioning (WebDAV) operation. The response body contains XML that describes
        /// the status codes.
        /// 成功
        /// 请求已成功处理，返回了多个状态的XML消息
        /// </summary>
        [Description("多状态XML消息")]
        MultiStatus = 207,

        /// <summary>
        /// Equivalent to HTTP status 208. System.Net.HttpStatusCode.AlreadyReported indicates
        /// that the members of a WebDAV binding have already been enumerated in a preceding
        /// part of the multistatus response, and are not being included again.
        /// 成功
        /// DAV绑定的成员列表已经包含在前一个响应中，并且不会再次发送
        /// </summary>
        [Description("响应已发送")]
        AlreadyReported = 208,

        /// <summary>
        /// Equivalent to HTTP status 226. System.Net.HttpStatusCode.IMUsed indicates that
        /// the server has fulfilled a request for the resource, and the response is a representation
        /// of the result of one or more instance-manipulations applied to the current instance.
        /// 成功
        /// 服务器已经完成对资源的一个响应。此响应代表了可用于当前实例的一个或多个操作的结果。
        /// </summary>
        [Description("已完成")]
        IMUsed = 226,

        /// <summary>
        /// Equivalent to HTTP status 300. System.Net.HttpStatusCode.Ambiguous indicates
        /// that the requested information has multiple representations. The default action
        /// is to treat this status as a redirect and follow the contents of the Location
        /// header associated with this response. Ambiguous is a synonym for MultipleChoices.
        /// 重定向
        /// 针对请求，服务器可执行多种操作。服务器可根据请求者 (user agent) 选择一项操作，或提供操作列表供请求者选择。
        /// </summary>
        [Description("多种选择")]
        Ambiguous = 300,

        /// <summary>
        /// Equivalent to HTTP status 300. System.Net.HttpStatusCode.MultipleChoices indicates
        /// that the requested information has multiple representations. The default action
        /// is to treat this status as a redirect and follow the contents of the Location
        /// header associated with this response. MultipleChoices is a synonym for Ambiguous.
        /// 重定向
        /// 针对请求，服务器可执行多种操作。服务器可根据请求者 (user agent) 选择一项操作，或提供操作列表供请求者选择。
        /// </summary>
        [Description("多种选择")]
        MultipleChoices = 300,

        /// <summary>
        /// Equivalent to HTTP status 301. System.Net.HttpStatusCode.Moved indicates that
        /// the requested information has been moved to the URI specified in the Location
        /// header. The default action when this status is received is to follow the Location
        /// header associated with the response. When the original request method was POST,
        /// the redirected request will use the GET method. Moved is a synonym for MovedPermanently.
        /// 重定向
        /// 请求的网页已永久移动到新位置。服务器返回此响应（对 GET 或 HEAD 请求的响应）时，会自动将请求者转到新位置。您应使用此代码告诉 Googlebot 某个网页或网站已永久移动到新位置。
        /// </summary>
        [Description("永久移动")]
        Moved = 301,

        /// <summary>
        /// Equivalent to HTTP status 301. System.Net.HttpStatusCode.MovedPermanently indicates
        /// that the requested information has been moved to the URI specified in the Location
        /// header. The default action when this status is received is to follow the Location
        /// header associated with the response. MovedPermanently is a synonym for Moved.
        /// 重定向
        /// 请求的网页已永久移动到新位置。服务器返回此响应（对 GET 或 HEAD 请求的响应）时，会自动将请求者转到新位置。您应使用此代码告诉 Googlebot 某个网页或网站已永久移动到新位置。
        /// </summary>
        [Description("永久移动")]
        MovedPermanently = 301,

        /// <summary>
        /// Equivalent to HTTP status 302. System.Net.HttpStatusCode.Found indicates that
        /// the requested information is located at the URI specified in the Location header.
        /// The default action when this status is received is to follow the Location header
        /// associated with the response. When the original request method was POST, the
        /// redirected request will use the GET method. Found is a synonym for Redirect.
        /// 重定向
        /// 服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 301 代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个网页或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。
        /// </summary>
        [Description("临时移动")]
        Found = 302,

        /// <summary>
        /// Equivalent to HTTP status 302. System.Net.HttpStatusCode.Redirect indicates that
        /// the requested information is located at the URI specified in the Location header.
        /// The default action when this status is received is to follow the Location header
        /// associated with the response. When the original request method was POST, the
        /// redirected request will use the GET method. Redirect is a synonym for Found.
        /// 重定向
        /// 服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 301 代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个网页或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。
        /// </summary>
        [Description("临时移动")]
        Redirect = 302,

        /// <summary>
        /// Equivalent to HTTP status 303. System.Net.HttpStatusCode.RedirectMethod automatically
        /// redirects the client to the URI specified in the Location header as the result
        /// of a POST. The request to the resource specified by the Location header will
        /// be made with a GET. RedirectMethod is a synonym for SeeOther.
        /// 重定向
        /// 请求者应当对不同的位置使用单独的 GET 请求来检索响应时，服务器返回此代码。对于除 HEAD 之外的所有请求，服务器会自动转到其他位置。
        /// </summary>
        [Description("查看其他位置")]
        RedirectMethod = 303,

        /// <summary>
        /// Equivalent to HTTP status 303. System.Net.HttpStatusCode.SeeOther automatically
        /// redirects the client to the URI specified in the Location header as the result
        /// of a POST. The request to the resource specified by the Location header will
        /// be made with a GET. SeeOther is a synonym for RedirectMethod.
        /// 重定向
        /// 请求者应当对不同的位置使用单独的 GET 请求来检索响应时，服务器返回此代码。对于除 HEAD 之外的所有请求，服务器会自动转到其他位置。
        /// </summary>
        [Description("查看其他位置")]
        SeeOther = 303,

        /// <summary>
        /// Equivalent to HTTP status 304. System.Net.HttpStatusCode.NotModified indicates
        /// that the client's cached copy is up to date. The contents of the resource are
        /// not transferred.
        /// 重定向
        /// 自从上次请求后，请求的网页未修改过。服务器返回此响应时，不会返回网页内容。如果网页自请求者上次请求后再也没有更改过，您应将服务器配置为返回此响应（称为 If-Modified-Since HTTP 标头）。服务器可以告诉 Googlebot 自从上次抓取后网页没有变更，进而节省带宽和开销。
        /// </summary>
        [Description("未修改")]
        NotModified = 304,

        /// <summary>
        /// Equivalent to HTTP status 305. System.Net.HttpStatusCode.UseProxy indicates that
        /// the request should use the proxy server at the URI specified in the Location
        /// header.
        /// 重定向
        /// 请求者只能使用代理访问请求的网页。如果服务器返回此响应，还表示请求者应使用代理。
        /// </summary>
        [Description("使用代理")]
        UseProxy = 305,

        /// <summary>
        /// Equivalent to HTTP status 306. System.Net.HttpStatusCode.Unused is a proposed
        /// extension to the HTTP/1.1 specification that is not fully specified.
        /// 重定向
        /// (已废弃)在最新版的规范中，306状态码已经不再被使用。
        /// </summary>
        [Description("已废弃")]
        Unused = 306,

        /// <summary>
        /// Equivalent to HTTP status 307. System.Net.HttpStatusCode.RedirectKeepVerb indicates
        /// that the request information is located at the URI specified in the Location
        /// header. The default action when this status is received is to follow the Location
        /// header associated with the response. When the original request method was POST,
        /// the redirected request will also use the POST method. RedirectKeepVerb is a synonym
        /// for TemporaryRedirect.
        /// 重定向
        /// 服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 301代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个页面或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。
        /// </summary>
        [Description("临时重定向")]
        RedirectKeepVerb = 307,

        /// <summary>
        /// Equivalent to HTTP status 307. System.Net.HttpStatusCode.TemporaryRedirect indicates
        /// that the request information is located at the URI specified in the Location
        /// header. The default action when this status is received is to follow the Location
        /// header associated with the response. When the original request method was POST,
        /// the redirected request will also use the POST method. TemporaryRedirect is a
        /// synonym for RedirectKeepVerb.
        /// 重定向
        /// 服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 301代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个页面或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。
        /// </summary>
        [Description("临时重定向")]
        TemporaryRedirect = 307,

        /// <summary>
        /// Equivalent to HTTP status 308. System.Net.HttpStatusCode.PermanentRedirect indicates
        /// that the request information is located at the URI specified in the Location
        /// header. The default action when this status is received is to follow the Location
        /// header associated with the response. When the original request method was POST,
        /// the redirected request will also use the POST method.
        /// 重定向
        /// 当前及未来的请求应该使用其他URI。307、308响应与302、301相似，但是不允许改变HTTP方法。
        /// </summary>
        [Description("永久重定向")]
        PermanentRedirect = 308,

        /// <summary>
        /// Equivalent to HTTP status 400. System.Net.HttpStatusCode.BadRequest indicates
        /// that the request could not be understood by the server. System.Net.HttpStatusCode.BadRequest
        /// is sent when no other error is applicable, or if the exact error is unknown or
        /// does not have its own error code.
        /// </summary>
        BadRequest = 400,

        /// <summary>
        /// Equivalent to HTTP status 401. System.Net.HttpStatusCode.Unauthorized indicates
        /// that the requested resource requires authentication. The WWW-Authenticate header
        /// contains the details of how to perform the authentication.
        /// </summary>
        Unauthorized = 401,

        /// <summary>
        /// Equivalent to HTTP status 402. System.Net.HttpStatusCode.PaymentRequired is reserved
        /// for future use.
        /// </summary>
        PaymentRequired = 402,

        /// <summary>
        /// Equivalent to HTTP status 403. System.Net.HttpStatusCode.Forbidden indicates
        /// that the server refuses to fulfill the request.
        /// </summary>
        Forbidden = 403,

        /// <summary>
        /// Equivalent to HTTP status 404. System.Net.HttpStatusCode.NotFound indicates that
        /// the requested resource does not exist on the server.
        /// </summary>
        NotFound = 404,

        /// <summary>
        /// Equivalent to HTTP status 405. System.Net.HttpStatusCode.MethodNotAllowed indicates
        /// that the request method (POST or GET) is not allowed on the requested resource.
        /// </summary>
        MethodNotAllowed = 405,

        /// <summary>
        /// Equivalent to HTTP status 406. System.Net.HttpStatusCode.NotAcceptable indicates
        /// that the client has indicated with Accept headers that it will not accept any
        /// of the available representations of the resource.
        /// </summary>
        NotAcceptable = 406,

        /// <summary>
        /// Equivalent to HTTP status 407. System.Net.HttpStatusCode.ProxyAuthenticationRequired
        /// indicates that the requested proxy requires authentication. The Proxy-authenticate
        /// header contains the details of how to perform the authentication.
        /// </summary>
        ProxyAuthenticationRequired = 407,

        /// <summary>
        /// Equivalent to HTTP status 408. System.Net.HttpStatusCode.RequestTimeout indicates
        /// that the client did not send a request within the time the server was expecting
        /// the request.
        /// </summary>
        RequestTimeout = 408,

        /// <summary>
        /// Equivalent to HTTP status 409. System.Net.HttpStatusCode.Conflict indicates that
        /// the request could not be carried out because of a conflict on the server.
        /// </summary>
        Conflict = 409,

        /// <summary>
        /// Equivalent to HTTP status 410. System.Net.HttpStatusCode.Gone indicates that
        /// the requested resource is no longer available.
        /// </summary>
        Gone = 410,

        /// <summary>
        /// Equivalent to HTTP status 411. System.Net.HttpStatusCode.LengthRequired indicates
        /// that the required Content-length header is missing.
        /// </summary>
        LengthRequired = 411,

        /// <summary>
        /// Equivalent to HTTP status 412. System.Net.HttpStatusCode.PreconditionFailed indicates
        /// that a condition set for this request failed, and the request cannot be carried
        /// out. Conditions are set with conditional request headers like If-Match, If-None-Match,
        /// or If-Unmodified-Since.
        /// </summary>
        PreconditionFailed = 412,

        /// <summary>
        /// Equivalent to HTTP status 413. System.Net.HttpStatusCode.RequestEntityTooLarge
        /// indicates that the request is too large for the server to process.
        /// </summary>
        RequestEntityTooLarge = 413,

        /// <summary>
        /// Equivalent to HTTP status 414. System.Net.HttpStatusCode.RequestUriTooLong indicates
        /// that the URI is too long.
        /// </summary>
        RequestUriTooLong = 414,

        /// <summary>
        /// Equivalent to HTTP status 415. System.Net.HttpStatusCode.UnsupportedMediaType
        /// indicates that the request is an unsupported type.
        /// </summary>
        UnsupportedMediaType = 415,

        /// <summary>
        /// Equivalent to HTTP status 416. System.Net.HttpStatusCode.RequestedRangeNotSatisfiable
        /// indicates that the range of data requested from the resource cannot be returned,
        /// either because the beginning of the range is before the beginning of the resource,
        /// or the end of the range is after the end of the resource.
        /// </summary>
        RequestedRangeNotSatisfiable = 416,

        /// <summary>
        /// Equivalent to HTTP status 417. System.Net.HttpStatusCode.ExpectationFailed indicates
        /// that an expectation given in an Expect header could not be met by the server.
        /// </summary>
        ExpectationFailed = 417,

        /// <summary>
        /// Equivalent to HTTP status 421. System.Net.HttpStatusCode.MisdirectedRequest indicates
        /// that the request was directed at a server that is not able to produce a response.
        /// </summary>
        MisdirectedRequest = 421,

        /// <summary>
        /// Equivalent to HTTP status 422. System.Net.HttpStatusCode.UnprocessableEntity
        /// indicates that the request was well-formed but was unable to be followed due
        /// to semantic errors.
        /// </summary>
        UnprocessableEntity = 422,

        /// <summary>
        /// Equivalent to HTTP status 423. System.Net.HttpStatusCode.Locked indicates that
        /// the source or destination resource is locked.
        /// </summary>
        Locked = 423,

        /// <summary>
        /// Equivalent to HTTP status 424. System.Net.HttpStatusCode.FailedDependency indicates
        /// that the method couldn't be performed on the resource because the requested action
        /// depended on another action and that action failed.
        /// </summary>
        FailedDependency = 424,

        /// <summary>
        /// Equivalent to HTTP status 426. System.Net.HttpStatusCode.UpgradeRequired indicates
        /// that the client should switch to a different protocol such as TLS/1.0.
        /// </summary>
        UpgradeRequired = 426,

        /// <summary>
        /// Equivalent to HTTP status 428. System.Net.HttpStatusCode.PreconditionRequired
        /// indicates that the server requires the request to be conditional.
        /// </summary>
        PreconditionRequired = 428,

        /// <summary>
        /// Equivalent to HTTP status 429. System.Net.HttpStatusCode.TooManyRequests indicates
        /// that the user has sent too many requests in a given amount of time.
        /// </summary>
        TooManyRequests = 429,

        /// <summary>
        /// Equivalent to HTTP status 431. System.Net.HttpStatusCode.RequestHeaderFieldsTooLarge
        /// indicates that the server is unwilling to process the request because its header
        /// fields (either an individual header field or all the header fields collectively)
        /// are too large.
        /// </summary>
        RequestHeaderFieldsTooLarge = 431,

        /// <summary>
        /// Equivalent to HTTP status 451. System.Net.HttpStatusCode.UnavailableForLegalReasons
        /// indicates that the server is denying access to the resource as a consequence
        /// of a legal demand.
        /// </summary>
        UnavailableForLegalReasons = 451,

        /// <summary>
        /// Equivalent to HTTP status 500. System.Net.HttpStatusCode.InternalServerError
        /// indicates that a generic error has occurred on the server.
        /// </summary>
        InternalServerError = 500,

        /// <summary>
        /// Equivalent to HTTP status 501. System.Net.HttpStatusCode.NotImplemented indicates
        /// that the server does not support the requested function.
        /// </summary>
        NotImplemented = 501,

        /// <summary>
        /// Equivalent to HTTP status 502. System.Net.HttpStatusCode.BadGateway indicates
        /// that an intermediate proxy server received a bad response from another proxy
        /// or the origin server.
        /// </summary>
        BadGateway = 502,

        /// <summary>
        /// Equivalent to HTTP status 503. System.Net.HttpStatusCode.ServiceUnavailable indicates
        /// that the server is temporarily unavailable, usually due to high load or maintenance.
        /// </summary>
        ServiceUnavailable = 503,

        /// <summary>
        /// Equivalent to HTTP status 504. System.Net.HttpStatusCode.GatewayTimeout indicates
        /// that an intermediate proxy server timed out while waiting for a response from
        /// another proxy or the origin server.
        /// </summary>
        GatewayTimeout = 504,

        /// <summary>
        /// Equivalent to HTTP status 505. System.Net.HttpStatusCode.HttpVersionNotSupported
        /// indicates that the requested HTTP version is not supported by the server.
        /// </summary>
        HttpVersionNotSupported = 505,

        /// <summary>
        /// Equivalent to HTTP status 506. System.Net.HttpStatusCode.VariantAlsoNegotiates
        /// indicates that the chosen variant resource is configured to engage in transparent
        /// content negotiation itself and, therefore, isn't a proper endpoint in the negotiation
        /// process.
        /// </summary>
        VariantAlsoNegotiates = 506,

        /// <summary>
        /// Equivalent to HTTP status 507. System.Net.HttpStatusCode.InsufficientStorage
        /// indicates that the server is unable to store the representation needed to complete
        /// the request.
        /// </summary>
        InsufficientStorage = 507,

        /// <summary>
        /// Equivalent to HTTP status 508. System.Net.HttpStatusCode.LoopDetected indicates
        /// that the server terminated an operation because it encountered an infinite loop
        /// while processing a WebDAV request with "Depth: infinity". This status code is
        /// meant for backward compatibility with clients not aware of the 208 status code
        /// System.Net.HttpStatusCode.AlreadyReported appearing in multistatus response bodies.
        /// </summary>
        LoopDetected = 508,

        /// <summary>
        /// Equivalent to HTTP status 510. System.Net.HttpStatusCode.NotExtended indicates
        /// that further extensions to the request are required for the server to fulfill
        /// it.
        /// </summary>
        NotExtended = 510,

        /// <summary>
        /// Equivalent to HTTP status 511. System.Net.HttpStatusCode.NetworkAuthenticationRequired
        /// indicates that the client needs to authenticate to gain network access; it's
        /// intended for use by intercepting proxies used to control access to the network.
        /// </summary>
        NetworkAuthenticationRequired = 511
        #endregion
    }
}
